home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cftransaction.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  39 lines

  1. <!--- This view-only example shows the use of CFTRANSACTION --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>CFTRANSACTION Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>CFTRANSACTION Example</H3>
  11.  
  12. <P>CFTRANSACTION can be used to group multiple queries
  13. using CFQUERY into a single business event.  Changes to data
  14. requested by these queries are not committed to the datasource
  15. until all actions within the transaction block have executed
  16. successfully.
  17. <P>The following is a sample listing (see code in other pane):
  18.  
  19. <!--- <CFTRANSACTION>
  20.     <CFQUERY NAME='makeNewCourse' DATASOURCE='Snippets'>
  21.     INSERT INTO Courses
  22.         (Course_Num, Descript)
  23.     VALUES
  24.         ('#myNumber#', '#myDescription#')
  25.     </CFQUERY>
  26.  
  27.     <CFQUERY NAME='insertNewCourseToList' DATASOURCE='Snippets'>
  28.     INSERT INTO CourseList
  29.         (CorNumber, CorDesc, Dept_ID,
  30.         CorName, CorLevel, LastUpdate)
  31.     VALUES
  32.         ('#myNumber#', '#myDescription#', '#myDepartment#',
  33.         '#myDescription#', '#myCorLevel#', #Now()#)
  34.     </CFQUERY>
  35. </CFTRANSACTION> --->
  36.  
  37. </BODY>
  38. </HTML>       
  39.